package com.sgb.kjwl.view.ui.adapter.self;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.TeamAuthListEntity;
import com.sgb.kjwl.model.entity.self.ComAuthListEntity;
import com.sgb.kjwl.view.widget.manage.StatusView;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

/***
 * 团队列表
 */
public class ComAuthListAdapter extends BaseRecycleAdapter<ComAuthListEntity> {

    private StatusView tvStatus;

    public ComAuthListAdapter(Context context, List<ComAuthListEntity> datas) {
        super(context, R.layout.item_com_auth_list, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final ComAuthListEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        tvStatus = holder.getItem().findViewById(R.id.tv_status);
        //1 待审核 2 审核未通过  3 审核通过 4 无需审核
        if (entity.getStatus() == 1) {
            tvStatus.setText("审核中");
            tvStatus.setBgColor(R.color.color_secondary_blue);
        } else if (entity.getStatus() == 2) {
            tvStatus.setText("认证失败");
            tvStatus.setBgColor(R.color.color_third_red_easy);
        } else if (entity.getStatus() == 3) {
            tvStatus.setText("已认证");
            tvStatus.setBgColor(R.color.color_secondary_green);
        }
    }
}
